-
-
Notifications
You must be signed in to change notification settings - Fork 268
feat(ramps): Reorganize RampsController initialization #7707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,018
−1,031
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…geolocation and countries, add countries to state, and create hydrateStore() for providers/tokens
Contributor
Author
|
cursor review |
amitabh94
reviewed
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
pkowalski
approved these changes
Jan 23, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation
Reorganizes RampsController initialization to separate critical startup data from region-specific data fetching. This change improves app startup performance by deferring non-essential data fetching until the wallet home page loads.
Additionally, there are interface updates as the API now returns countries with
supported: { buy: true, sell: true }.Changes
init()method: Now only fetches geolocation and countries (24h TTL) on engine instantiationhydrateState()method: New method that fetches providers and tokens for the user's region, called on wallet home page loadcountries: Country[]to controller state with 24 hour TTL cachinggetCountries(): Removedactionparameter - API now returns buy/sell support info in a single responsesetUserRegion(): Refactored to use countries from state instead of fetching themSupportedActionstype: New type{ buy: boolean; sell: boolean }for region support infoCountry.supported/State.supported: Changed frombooleantoSupportedActionsobjectBenefits
hydrateState()will be called on wallet page loadsetUserRegion()could fail if sell countries were fetched after initReferences
https://consensyssoftware.atlassian.net/browse/TRAM-3230
Checklist
Note
Reorganizes ramps initialization and country support handling, with new state and API types.
init()now only fetches geolocation andgetCountries(); newhydrateState()defers fetchingtokens/providersuntil latercountries: Country[]persisted in controller state (24h TTL via request cache);getCountries()saves to stateCountry.supported/State.supportedchanged frombooleantoSupportedActions{ buy; sell }; exportedSupportedActionsgetCountries()no longer accepts anactionparameter; service endpoint call updated and filtering logic adjusted to buy/sell supportsetUserRegion()now uses countries from state and triggers fetches; added internal cleanup; removedupdateUserRegion()and its trigger; updated trigger method signaturesWritten by Cursor Bugbot for commit 556edd5. This will update automatically on new commits. Configure here.